def neuron_and_alt(x1, x2, w1, w2, bias):
    z = w1 * x1 + w2 * x2 + bias
    if z >= 0:
        return 1
    else:
        return 0


def neuron_and(inputs, weights, bias):
    z = sum(i * w for i, w in zip(inputs, weights)) + bias
    if z >= 0:
        return 1
    else:
        return 0


def neuron_nand(inputs, weights, bias):
    z = sum(i * w for i, w in zip(inputs, weights)) + bias
    if z >= 0:
        return 1
    else:
        return 0


def neuron_not(x1, w1, bias):
    z = w1 * x1 + bias
    if z >= 0:
        return 1
    else:
        return 0
